package com.example.demo.niuke;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @Author: liull
 * @Description: 棋牌走法
 * 输入 n x m的棋盘
 * 只允许向右 向下
 * 输出：总共的走法
 * @Date: Created in 14:44 2020/3/26
 * @Modified By:
 */
public class Main36 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line1;
        while ((line1 = br.readLine()) != null) {
            int n = Integer.parseInt(line1);
            int m = Integer.parseInt(br.readLine());
            System.out.println(calc(n, m));
        }
    }

    public static int calc(int m, int n) {
        // 限制 n+1 m+1不可以n-1 m-1
        // 因为沿着边缘 所以n+1 m+1
        if (m == 0 || n == 0) {
            return 1;
        }
        return calc(m - 1, n) + calc(m, n - 1);
    }
}
